<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <link rel="shortcut icon" href="favicon.ico">
    <link href="/state/css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="/state/css/style.min.css" rel="stylesheet">
    <link href="/state/css/plugins/switchery/switchery.css" rel="stylesheet">
    <!-- 加载编辑器的容器 -->

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="post" id="form1" name="form1" class="form-horizontal" action="/adminchy/Room/solitaireEditRoom">
                        
                        <input hidden="true" name="room_id" value="{$room.room_id}">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">房间名称:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" placeholder="必填" id="room_name" name="room_name" value="{$room.room_name}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">规则:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" placeholder="必填" id="gold_range" name="gold_range" value="{$room.gold_range}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">规则:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" placeholder="必填" id="game_intro" name="game_intro" value="{$room.game_intro}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">单包金额:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" placeholder="必填" id="money" name="money" value="{$room.money}">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">红包份数:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" placeholder="必填" id="pocket" name="pocket" value="{$room.pocket}">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">红包过期时间:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" placeholder="必填" id="term" name="term" value="{$room.term}">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">确认修改</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/state/js/jquery.min.js"></script>
<script src="/state/js/jquery.form.js"></script>
<script src="/state/js/plugins/layer/layer.min.js"></script>
<script src="/state/js/common.js"></script>
<script>
    $(function(){
        $('#form1').ajaxForm({
            beforeSubmit: checkFun,
            success: complete,
            dataType: 'json'
        });
       $("#type").find("option:selected").val();
        function checkFun(){

            if($('#room_name').val() == ''){
                layer.tips('房间名称不能为空', '#room_name',{
                    tips: [2, '#d9534f']
                });
                $('#room_name').focus();
                return false;
            }

        }
        function complete(data){
            if(data.status == 0){
                layer.msg(data.message, {icon: 6,time:1000},function(){
                    window.parent.location.reload();
                 });
            }else{
                layer.msg(data.message, {icon: 5,time:1000},function(){
                    window.parent.location.reload();
                 });
            }
             
        }
    })
</script>
</body>
</html>
